home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-06 | 2.3 KB | 79 lines | [TEXT/CWIE] |
- // Copyright (C) 1999 Eric Roccasecca. All rights reserved.
-
- #include "X_Ray_Priv.h"
-
- void X_Ray_TransparentCalcRgns (WindowPeek window, long param);
-
- // creates an instance of the X_Ray_WDEF
- void X_Ray_BuildWDEF (void)
- {
- OSErr err;
-
- RoutineDescriptor wdefProc = BUILD_ROUTINE_DESCRIPTOR(uppWindowDefProcInfo, X_Ray_WDEF);
-
- gCommRec.wdefStub = NewHandleSysClear (sizeof(X_Ray_WDEFRec));
- HLock (gCommRec.wdefStub);
- (*(X_Ray_WDEFHandle)(gCommRec.wdefStub))->wdefProc = wdefProc;
- }
-
-
- // the WDEF path for making other windows transparent
- pascal long X_Ray_WDEF (short varCode, WindowPeek theWindow, short message, long param)
- {
- long result;
- Handle stdWDEF;
-
-
- stdWDEF = (Handle)X_Ray_GetWindowFeature ((WindowPtr)theWindow, kTransWindowStandardWDEF);
- result = CallWindowDefProc ((RoutineDescriptor*)*stdWDEF, varCode, theWindow, message, param);
-
- // X_Ray only needs to be aware of certain messages
- switch (message)
- {
- case kWindowMsgInitialize:
- break;
- case kWindowMsgCleanUp:
- break;
- case kWindowMsgDraw:
- break;
- case kWindowMsgHitTest:
- break;
- case kWindowMsgCalculateShape:
- X_Ray_TransparentCalcRgns ((WindowPeek)theWindow, param);
- break;
- case kWindowMsgStateChanged:
- // As of Mac OS 8.5 this doesn't work. How lame.
- /*if (param & kWindowStateTitleChanged)
- DebugStr ("\ptitle changed");
- if (param & kWindowStateSizeChanged)
- DebugStr ("\psize changed");
- if (param & kWindowStatePositionChanged)
- DebugStr ("\pposition changed");
- if (param & kWindowStateZOrderChanged)
- DebugStr ("\pz-order changed");
- if (param & kWindowStateVisibilityChanged)
- DebugStr ("\pvisibility changed");
- if (param & kWindowStateHiliteChanged)
- DebugStr ("\philite changed");
- if (param & kWindowStateCollapseChanged)
- DebugStr ("\pcollapse changed");*/
- break;
- case kWindowMsgGetFeatures:
- //if (*(long*)param & kWindowWantsDisposeAtProcessDeath)
- // DebugStr ("\pstd WDEF supports dispose at proc death msg");
- break;
- default:
- break;
- }
-
- return result;
- }
-
-
- // recalcs window regions to make them transparent
- void X_Ray_TransparentCalcRgns (WindowPeek window, long param)
- {
- DiffRgn (window->strucRgn, window->contRgn, window->strucRgn); // make window have a transparent/hollow struct region
- // maybe add code the update sizes of all offscreen buffers to new size of window
- }
-